﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SQLite;
using System.IO;

namespace HolidayMailer
{
    
    public partial class Email : Form
    {
        SQLiteConnection sqlconnection;
        SQLiteCommand createTable;
        public Email()
        {
            Control.CheckForIllegalCrossThreadCalls = false;

            // create a new database connection:
            if (File.Exists("database.db"))
                sqlconnection = new SQLiteConnection("Data Source=database.db;Version=3;New=False;Compress=True;");
            else
            {
                sqlconnection = new SQLiteConnection("Data Source=database.db;Version=3;New=True;Compress=True;");
                // open the connection:
                sqlconnection.Open();

                // create a new SQL command:
                createTable = sqlconnection.CreateCommand();
                createTable.CommandText = "CREATE TABLE SMTP (sender varchar(30),server varchar(30));";
                createTable.ExecuteNonQuery();
                sqlconnection.Close();

            }
            InitializeComponent();
        }
    }
}
